package cn.sciento.boot.transfer.api.controller.v1;


import cn.sciento.swagger.annotation.Permission;
import io.swagger.annotations.ApiOperation;
import cn.sciento.boot.transfer.app.service.ProducerEventService;
import cn.sciento.core.base.BaseController;
import cn.sciento.core.util.Results;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController("producerEventController.v1")
@RequestMapping({"/v1/producer-events"})
public class ProducerEventController extends BaseController {
  @Autowired
  private ProducerEventService producerEventService;
  
  @ApiOperation("生产事件列表")
  @Permission(permissionLogin = true)
  @PostMapping({"/retry"})
  public ResponseEntity<Long> list(@RequestParam("eventId") Long eventId) {
    this.producerEventService.reSentProducerEvent(eventId);
    return Results.success(eventId);
  }
}
